Skip to main content

Struct ImVectorWrapper<T>

Wrapper for ImVector.

Assembly: Dalamud.dll
View Source
Declaration
public struct ImVectorWrapper<T> : IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IDisposable where T : unmanaged

Implements:

Expand

System.Collections.Generic.IList<<T>>, System.Collections.Generic.ICollection<<T>>, System.Collections.IList, System.Collections.ICollection, System.Collections.Generic.IReadOnlyList<<T>>, System.Collections.Generic.IReadOnlyCollection<<T>>, System.Collections.Generic.IEnumerable<<T>>, System.Collections.IEnumerable, System.IDisposable

Properties

RawVector

Gets the raw vector.

View Source
Declaration
public ImVector* RawVector { get; }

DataSpan

Gets a System.Span%601 view of the underlying ImVector{T}, for the range of Dalamud.Interface.Utility.ImVectorWrapper%601.Length.

View Source
Declaration
public Span<T> DataSpan { get; }

StorageSpan

Gets a System.Span%601 view of the underlying ImVector{T}, for the range of Dalamud.Interface.Utility.ImVectorWrapper%601.Capacity.

View Source
Declaration
public Span<T> StorageSpan { get; }

IsDisposed

Gets a value indicating whether this Dalamud.Interface.Utility.ImVectorWrapper%601 is disposed.

View Source
Declaration
public bool IsDisposed { get; }

HasOwnership

Gets a value indicating whether this Dalamud.Interface.Utility.ImVectorWrapper%601 has the ownership of the underlying ImGuiNET.ImVector.

View Source
Declaration
public readonly bool HasOwnership { get; }

Vector

Gets the underlying ImGuiNET.ImVector.

View Source
Declaration
public ImVector* Vector { get; }

Length

Gets the number of items contained inside the underlying ImVector{T}.

View Source
Declaration
public int Length { get; }

Capacity

Gets the number of items <b>that can be</b> contained inside the underlying ImVector{T}.

View Source
Declaration
public int Capacity { get; }

Data

Gets the pointer to the first item in the data inside underlying ImVector{T}.

View Source
Declaration
public T* Data { get; }

LengthUnsafe

Gets the reference to the number of items contained inside the underlying ImVector{T}.

View Source
Declaration
public ref int LengthUnsafe { get; }

CapacityUnsafe

Gets the reference to the number of items <b>that can be</b> contained inside the underlying ImVector{T}.

View Source
Declaration
public ref int CapacityUnsafe { get; }

DataUnsafe

Gets the reference to the pointer to the first item in the data inside underlying ImVector{T}.

View Source
Declaration
public ref T* DataUnsafe { get; }

IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection%601 is read-only.

View Source
Declaration
public bool IsReadOnly { get; }

this[int]

Gets the element at the specified index as a reference.

View Source
Declaration
public ref T this[int index] { get; }

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
Declaration
public void Dispose()

GetEnumerator()

Returns an enumerator that iterates through the collection.

View Source
Declaration
public IEnumerator<T> GetEnumerator()
Returns

System.Collections.Generic.IEnumerator<<T>>: An enumerator that can be used to iterate through the collection.### Add(in T) Adds an item to the System.Collections.Generic.ICollection%601.

View Source
Declaration
public void Add(in T item)
Parameters
TypeNameDescription
<T>itemThe object to add to the System.Collections.Generic.ICollection%601.
Exceptions

System.NotSupportedException
The System.Collections.Generic.ICollection%601 is read-only.

AddRange(IEnumerable<T>)

Adds the elements of the specified collection to the end of the System.Collections.Generic.List%601.

View Source
Declaration
public void AddRange(IEnumerable<T> items)
Parameters
TypeName
System.Collections.Generic.IEnumerable<<T>>items
Exceptions

System.ArgumentNullException
<code class="paramref">collection</code> is null.

AddRange(ReadOnlySpan<T>)

Adds the elements of the specified collection to the end of the System.Collections.Generic.List%601.

View Source
Declaration
public void AddRange(ReadOnlySpan<T> items)
Parameters
TypeName
System.ReadOnlySpan<<T>>items
Exceptions

System.ArgumentNullException
<code class="paramref">collection</code> is null.

Clear()

Removes all items from the System.Collections.Generic.ICollection%601.

View Source
Declaration
public void Clear()
Exceptions

System.NotSupportedException
The System.Collections.Generic.ICollection%601 is read-only.

Clear(bool)

Clears this vector, optionally skipping destroyer invocation.

View Source
Declaration
public void Clear(bool skipDestroyer)
Parameters
TypeNameDescription
System.BooleanskipDestroyerWhether to skip destroyer invocation.

Contains(in T)

Determines whether the System.Collections.Generic.ICollection%601 contains a specific value.

View Source
Declaration
public bool Contains(in T item)
Returns

System.Boolean: true if <code class="paramref">item</code> is found in the System.Collections.Generic.ICollection%601; otherwise, false.

Parameters
TypeNameDescription
<T>itemThe object to locate in the System.Collections.Generic.ICollection%601.

Compact(int)

Size down the underlying ImVector{T}.

View Source
Declaration
public bool Compact(int reservation)
Returns

System.Boolean: Whether the capacity has been changed.

Parameters
TypeNameDescription
System.Int32reservationCapacity to reserve.

CopyTo(T[], int)

Copies the elements of the System.Collections.Generic.ICollection%601 to an System.Array, starting at a particular System.Array index.

View Source
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
TypeNameDescription
<T>[]arrayThe one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection%601. The System.Array must have zero-based indexing.
System.Int32arrayIndexThe zero-based index in <code class="paramref">array</code> at which copying begins.
Exceptions

System.ArgumentNullException
<code class="paramref">array</code> is null. System.ArgumentOutOfRangeException
<code class="paramref">arrayIndex</code> is less than 0. System.ArgumentException
The number of elements in the source System.Collections.Generic.ICollection%601 is greater than the available space from <code class="paramref">arrayIndex</code> to the end of the destination <code class="paramref">array</code>.

EnsureCapacity(int)

Ensures that the capacity of this list is at least the specified <code class="paramref">capacity</code>.

On growth, the new capacity exactly matches <code class="paramref">capacity</code>.

View Source
Declaration
public bool EnsureCapacity(int capacity)
Returns

System.Boolean: Whether the capacity has been changed.

Parameters
TypeNameDescription
System.Int32capacityThe minimum capacity to ensure.

EnsureCapacityExponential(int)

Ensures that the capacity of this list is at least the specified <code class="paramref">capacity</code>.

On growth, the new capacity may exceed <code class="paramref">capacity</code>.

View Source
Declaration
public bool EnsureCapacityExponential(int capacity)
Returns

System.Boolean: Whether the capacity has been changed.

Parameters
TypeNameDescription
System.Int32capacityThe minimum capacity to ensure.

Resize(int, in T, bool)

Resizes the underlying array and fills with zeroes if grown.

View Source
Declaration
public void Resize(int size, in T defaultValue = default, bool skipDestroyer = false)
Parameters
TypeNameDescription
System.Int32sizeNew size.
<T>defaultValueNew default value.
System.BooleanskipDestroyerWhether to skip calling destroyer function.

Remove(in T)

Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection%601.

View Source
Declaration
public bool Remove(in T item)
Returns

System.Boolean: true if <code class="paramref">item</code> was successfully removed from the System.Collections.Generic.ICollection%601; otherwise, false. This method also returns false if <code class="paramref">item</code> is not found in the original System.Collections.Generic.ICollection%601.

Parameters
TypeNameDescription
<T>itemThe object to remove from the System.Collections.Generic.ICollection%601.
Exceptions

System.NotSupportedException
The System.Collections.Generic.ICollection%601 is read-only.

IndexOf(in T)

Determines the index of a specific item in the System.Collections.Generic.IList%601.

View Source
Declaration
public int IndexOf(in T item)
Returns

System.Int32: The index of <code class="paramref">item</code> if found in the list; otherwise, -1.

Parameters
TypeNameDescription
<T>itemThe object to locate in the System.Collections.Generic.IList%601.

Insert(int, in T)

Inserts an item to the System.Collections.Generic.IList%601 at the specified index.

View Source
Declaration
public void Insert(int index, in T item)
Parameters
TypeNameDescription
System.Int32indexThe zero-based index at which <code class="paramref">item</code> should be inserted.
<T>itemThe object to insert into the System.Collections.Generic.IList%601.
Exceptions

System.ArgumentOutOfRangeException
<code class="paramref">index</code> is not a valid index in the System.Collections.Generic.IList%601. System.NotSupportedException
The System.Collections.Generic.IList%601 is read-only.

InsertRange(int, IEnumerable<T>)

Inserts the elements of a collection into the System.Collections.Generic.List%601 at the specified index.

View Source
Declaration
public void InsertRange(int index, IEnumerable<T> items)
Parameters
TypeNameDescription
System.Int32indexThe zero-based index at which the new elements should be inserted.
System.Collections.Generic.IEnumerable<<T>>items
Exceptions

System.ArgumentNullException
<code class="paramref">collection</code> is null. System.ArgumentOutOfRangeException
<code class="paramref">index</code> is less than 0.

-or-

<code class="paramref">index</code> is greater than System.Collections.Generic.List%601.Count.

InsertRange(int, ReadOnlySpan<T>)

Inserts the elements of a collection into the System.Collections.Generic.List%601 at the specified index.

View Source
Declaration
public void InsertRange(int index, ReadOnlySpan<T> items)
Parameters
TypeNameDescription
System.Int32indexThe zero-based index at which the new elements should be inserted.
System.ReadOnlySpan<<T>>items
Exceptions

System.ArgumentNullException
<code class="paramref">collection</code> is null. System.ArgumentOutOfRangeException
<code class="paramref">index</code> is less than 0.

-or-

<code class="paramref">index</code> is greater than System.Collections.Generic.List%601.Count.

RemoveAt(int, bool)

Removes the element at the given index.

View Source
Declaration
public void RemoveAt(int index, bool skipDestroyer = false)
Parameters
TypeNameDescription
System.Int32indexThe index.
System.BooleanskipDestroyerWhether to skip calling the destroyer function.

RemoveRange(int, int, bool)

Removes <code class="paramref">count</code> elements at the given index.

View Source
Declaration
public void RemoveRange(int index, int count, bool skipDestroyer = false)
Parameters
TypeNameDescription
System.Int32indexThe index of the first item to remove.
System.Int32countNumber of items to remove.
System.BooleanskipDestroyerWhether to skip calling the destroyer function.

ReplaceRange(int, int, ReadOnlySpan<T>, bool)

Replaces a sequence at given offset <code class="paramref">index</code> of <code class="paramref">count</code> items with <code class="paramref">replacement</code>.

View Source
Declaration
public void ReplaceRange(int index, int count, ReadOnlySpan<T> replacement, bool skipDestroyer = false)
Parameters
TypeNameDescription
System.Int32indexThe index of the first item to be replaced.
System.Int32countThe number of items to be replaced.
System.ReadOnlySpan<<T>>replacementThe replacement.
System.BooleanskipDestroyerWhether to skip calling the destroyer function.

SetCapacity(int)

Sets the capacity exactly as requested.

View Source
Declaration
public bool SetCapacity(int capacity)
Returns

System.Boolean: Whether the capacity has been changed.

Parameters
TypeNameDescription
System.Int32capacityNew capacity.
Exceptions

System.ArgumentOutOfRangeException
If <code class="paramref">capacity</code> is less than Dalamud.Interface.Utility.ImVectorWrapper%601.Length. System.OutOfMemoryException
If memory for the requested capacity cannot be allocated.

Implements

  • System.Collections.Generic.IList<<T>>
  • System.Collections.Generic.ICollection<<T>>
  • System.Collections.IList
  • System.Collections.ICollection
  • System.Collections.Generic.IReadOnlyList<<T>>
  • System.Collections.Generic.IReadOnlyCollection<<T>>
  • System.Collections.Generic.IEnumerable<<T>>
  • System.Collections.IEnumerable
  • System.IDisposable